<%-- 
    Document   : changePass
    Created on : Jul 8, 2013, 9:52:52 AM
    Author     : ASUS K43E
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Change password | Lafitte</title>
        <link rel="shortcut icon" href="./images2/logo.jpg">

        <style type="text/css" media="screen">
            body{
                background-image: url(images2/Untitled.jpg);
                background-repeat: no-repeat;
                background-color: black;
            }
            .container[role="main"] {
                padding-bottom: 60px;
            }
            .bottombar {
                position: fixed;
                bottom: 0;
                left: 0;
                right: 0;
            }
        </style>

        <script>
            function valiOld(oldPass){
                if (oldPass.value.length == 0) {
                    document.getElementById("oldError").innerHTML='Old password is required!';
                    return false;
                }
                document.getElementById("oldError").innerHTML='';
                return true;
            }
            function valiNew(oldPass){
                if (oldPass.value.length == 0) {
                    document.getElementById("newError").innerHTML='New password is required!';
                    return false;
                }
                document.getElementById("newError").innerHTML='';
                return true;
            }
            function valiCon(conPass){
                var n=document.getElementById("newPass").value;
                if(conPass.value != n){
                    document.getElementById("conError").innerHTML='Confirm new password does not match new password!';
                    return false;
                }
                if (conPass.value.length == 0) {
                    document.getElementById("conError").innerHTML='Confirm new password is required!';
                    return false;
                }
                document.getElementById("conError").innerHTML='';
                return true;
            }
        </script>
    </head>
    <body>
        <div class="container-fluid">
            <div class="row-fluid">
                <div class="span4"></div>
                <div class="span6" align="center">
                    <jsp:include page="menubar.jsp" flush=""/>
                    <<h2><font color="white">Change password</font></h2>
                    <form action="Controller" method="POST">
                        <table border="0">
                            <tr>
                                <td style="color: white">Old password:</td>
                                <td><input type="password" name="txtcusOldPass" value="" onblur="valiOld(this);" /></td>
                                <td><label style="color: red" id="oldError">
                                        <c:if test="${not empty MESSOP}">${MESSOP}</c:if>
                                    </label></td>
                            </tr>
                            <tr>
                                <td style="color: white">New password:</td>
                                <td><input type="password" name="txtcusNewPass" value="" onblur="valiNew(this);" id="newPass"/></td>
                                <td><label style="color: red" id="newError">
                                        <c:if test="${not empty MESSNP}">${MESSNP}</c:if>
                                    </label></td>
                            </tr>
                            <tr>
                                <td style="color: white">Confirm new password:</td>
                                <td><input type="password" name="txtconNewPass" value="" onblur="valiCon(this);"/></td>
                                <td><label style="color: red" id="conError">
                                        <c:if test="${not empty MESSCNP}">${MESSCNP}</c:if>
                                    </label></td>
                            </tr>
                            <tr>
                                <td><input type="hidden" name="txtUsername" value="${USER}" /> </td>
                                <td align="right"><input type="submit" value="Save Password" name="btAction" class="btn btn-inverse"/></td>
                            </tr>
                        </table>
                    </form>
                </div>
            </div>
        </div>
        <div class="bottombar">
            <div class="bottom-inner">
                <div class="container">
                    <jsp:include page="footer.jsp" flush="" />
                </div>
            </div>
        </div>
    </body>
</html>
